<!--********************************************************************
* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
*********************************************************************-->
<!--********************************************************************
* 该示例需要引入
* Mapv (https://github.com/huiyan-fe/mapv)
*********************************************************************-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title data-i18n="resources.title_mapvCsvcar"></title>
    <script type="text/javascript" include="jquery" src="../js/include-web.js"></script>
</head>
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
<script type="text/javascript" include="mapv" src="../../dist/leaflet/include-leaflet.js"></script>
<script type="text/javascript">
    var map = L.map('map', {
        center: [29.56, 106.56],
        zoom: 11,
    });
    var host = window.isLocal ? window.server : "https://iserver.supermap.io";
    var url = host + "/iserver/services/map-china/rest/maps/ChinaDark";

    new L.supermap.TiledMapLayer(url).addTo(map);
    loadData();

    //示例数据来源为百度MapV的加偏数据，iClient未做纠偏处理
    function loadData() {
        $.get('../data/car.csv', function (csvstr) {
            var dataSet = mapv.csv.getDataSet(csvstr);
            var options = {
                strokeStyle: 'rgba(50, 50, 255, 0.8)',
                lineWidth: 0.05,
                globalCompositeOperation: 'lighter',
                draw: 'simple'
            };
            var dataAttr = resources.text_dataSources + "<a target='_blank' href='https://mapv.baidu.com/examples/csv-car.html'> MapV</a>,";
            new L.supermap.MapVLayer(dataSet, options, {attributionPrefix: dataAttr}).addTo(map);
            setTimeout(function () {
                map.openPopup(resources.text_iClient, map.getCenter());
            }, 1000)
        });
    }

</script>

</body>
</html>
